package com.mq;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author ytj
 * @date 2024/1/18
 */
@Component
@RabbitListener(queues = Demo10Message.QUEUE_NAME,concurrency="3")
public class Demo10Consumer {

    @RabbitHandler
    public void message(Demo10Message message){
        System.out.println("当前线程为:"+Thread.currentThread().getId()+",消息内容为:"+message.getId());
    }
}
